New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow any key in Renderer environment hash #26786
Conversation
r? @eileencodes (@rails-bot has picked a reviewer for you, use r? to override) |
Depends, could you show the use case for this? Right now I don't see why people would want this. |
In my case, I want to pass a key for Warden so that my templates will not throw errors. But more generally, I was rather surprised that it converted my keys to |
I think a better way to go about it might be how it handles the values though: |
More specifically, if I do something like this:
Then in the template, if we check This pull request fixes it so that the renderer will not produce the extra |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the explanation. Could you add a test case and a CHANGELOG entry?
When rendering arbitrary templates, it is helpful to not overwrite `env` keys with nil if they don't match any found in the `RACK_KEY_TRANSLATION` This allows the developer to set the environment to exactly what is needed for rendering.
Thanks @rafaelfranca, and done! |
Thanks @codeodor! 😄 |
When rendering arbitrary templates, it would be helpful to not overwrite
env
keys withnil
if they don't match any found in theRACK_KEY_TRANSLATION
hash.Is there any interest in this?